import { axios } from '@/utils/request'
let uri = process.env.NODE_ENV === 'production' ? '' : '/yb'

const api = {
    // 首页数据
    statisticalByUserDept: uri + '/category/info/statisticalByUserDept',
    statisticalBycategoryId: uri + '/category/info/statisticalBycategoryId',
    statisticalByLableType: uri + '/category/info/statisticalByLableType',
    statisticalByState: uri + '/category/info/statisticalByState',
    statisticalByPrice: uri + '/category/info/statisticalByPrice',

    //打印日志
    printLog: uri + '/assetsPrintLog/create',
    //资产信息
    getCategoryInfo: '/category/info/get',
    getTemplate: uri + '/printTemplate/getTemplate', // 打印获取模板
    // 资产类别
    categoryPage: uri + '/category/all',
    categoryCreate: uri + '/category/create',
    categoryDelete: uri + '/category/delete',
    categoryUpdate: uri + '/category/update',
    // 清查管理
    infoAll: uri + '/category/info/checkPage', //固定资产名称查询
    infoUpdate: uri + '/category/info/update', // 修改数据
    checkListDetailRecord: uri + '/category/checkNote/querySingleCheckList', // 资产信息详情-盘点记录
    queryHistoryPic: uri + '/category/checkNote/queryHistoryPic', // 资产信息详情-历史记录
    checkList: uri + '/category/info/unCheckPage',
    infoCreate: uri + '/category/info/create', // 固定资产新增
    categoryTree: uri + '/category/getTree',
    fuzzyQuery: uri + '/category/directorys/fuzzyQuery',
    supplierFuzzyQuery: uri + '/category/supplier/fuzzyQuery',
    createSupplier: uri + '/category/info/createSupplier',
    deleteCheckList: uri + '/category/info/changeState',
    checkDelete: uri + '/category/info/delete',  // 审核不通过
    checkPass: uri + '/category/info/audit',
    // 盘点计划
    checkState: uri + '/category/checkPlan/suspend', // 改变状态
    checkPlanAll: uri + '/category/checkPlan/page',
    planDetails: uri + '/category/checkDetailed/planDetails',
    queryCheckList: uri + '/category/checkNote/queryCheckList', // 盘点计划详情-盘点记录
    checkPlanCreate: uri + '/category/checkPlan/create',
    checkPlanDelete: uri + '/category/checkPlan/delete',
    queryUserList: uri + '/category/checkPlan/queryUserList',
    queryName: uri + '/category/checkPlan/queryName',
    queryCheckInfo: uri + '/category/checkPlan/queryCheckInfo',  // 查看审核信息
    // 任务审核详情
    auditDetailCheck: uri + '/category/checkNote/check',
    normalUnaudited: uri + '/category/checkNote/normalUnaudited', // 正常未审核
    changeUnaudited: uri + '/category/checkNote/changeUnaudited', // 状态改变未审核
    haveAudited: uri + '/category/checkNote/audited', // 已审核
    // 门禁设备
    assetsAccessPage: uri + '/assetsAccess/page',
    assetsAccessCreate: uri + '/assetsAccess/create',
    assetsAccessUpdate: uri + '/assetsAccess/update',
    assetsAccessDelete: uri + '/assetsAccess/delete',
    assetsAntennaPage: uri + '/accessAntenna/page', // 天线设备
    accessAntennaCreate: uri + '/accessAntenna/create',
    accessAntennaUpdate: uri + '/accessAntenna/update',
    accessAntennaDelete: uri + '/accessAntenna/delete'
}

// getCategoryInfo
export function getCategoryInfo(id, params = {}) {
    return axios({
        url: `${api.getCategoryInfo}/${id}`,
        method: 'get',
        params
    })
}

// statisticalByUserDept
export function statisticalByUserDept(params) {
    return axios({
        url: api.statisticalByUserDept,
        method: 'get',
        params
    })
}

export function statisticalBycategoryId(params) {
    return axios({
        url: api.statisticalBycategoryId,
        method: 'get',
        params
    })
}

export function statisticalByLableType(params) {
    return axios({
        url: api.statisticalByLableType,
        method: 'get',
        params
    })
}

export function statisticalByState(params) {
    return axios({
        url: api.statisticalByState,
        method: 'get',
        params
    })
}

export function statisticalByPrice(params) {
    return axios({
        url: api.statisticalByPrice,
        method: 'get',
        params
    })
}

// categoryCreate
export function categoryCreate(data) {
    return axios({
        url: api.categoryCreate,
        method: 'post',
        data
    })
}

export function categoryDelete(id, data) {
    return axios({
        url: `${api.categoryDelete}/${id}`,
        method: 'delete',
        data
    })
}

export function categoryUpdate(data) {
    return axios({
        url: api.categoryUpdate,
        method: 'put',
        data
    })
}

// 天线设备
export function assetsAntennaPage(params) {
    return axios({
        url: api.assetsAntennaPage,
        method: 'get',
        params
    })
}

export function accessAntennaCreate(data) {
    return axios({
        url: api.accessAntennaCreate,
        method: 'post',
        data
    })
}

export function accessAntennaUpdate(data) {
    return axios({
        url: api.accessAntennaUpdate,
        method: 'put',
        data
    })
}

export function accessAntennaDelete(id, params) {
    return axios({
        url: `${api.accessAntennaDelete}/${id}`,
        method: 'delete',
        params
    })
}

// 门禁设备分页查询
export function assetsAccessPage(params) {
    return axios({
        url: api.assetsAccessPage,
        method: 'get',
        params
    })
}

// 门禁设备新增
export function assetsAccessCreate(data) {
    return axios({
        url: api.assetsAccessCreate,
        method: 'post',
        data
    })
}

// assetsAccessUpdate
export function assetsAccessUpdate(data) {
    return axios({
        url: api.assetsAccessUpdate,
        method: 'put',
        data
    })
}

// assetsAccessDelete
export function assetsAccessDelete(id, params) {
    return axios({
        url: `${api.assetsAccessDelete}/${id}`,
        method: 'delete',
        params
    })
}

// 盘点任务审核
export function auditDetailCheck(data) {
    return axios({
        url: api.auditDetailCheck,
        method: 'post',
        data
    })
}

// 打印日志 printLog
export function printLog(data) {
    return axios({
        url: api.printLog,
        method: 'post',
        data
    })
}

// normalUnaudited
export function normalUnaudited(params) {
    return axios({
        url: api.normalUnaudited,
        method: 'get',
        params
    })
}

// changeUnaudited
export function changeUnaudited(params) {
    return axios({
        url: api.changeUnaudited,
        method: 'get',
        params
    })
}

// haveAudited
export function haveAudited(params) {
    return axios({
        url: api.haveAudited,
        method: 'get',
        params
    })
}

// 资产信息详情-历史图片
export function queryHistoryPic(params) {
    return axios({
        url: api.queryHistoryPic,
        method: 'get',
        params
    })
}

// 资产信息详情-盘点记录
export function checkListDetailRecord(params) {
    return axios({
        url: api.checkListDetailRecord,
        method: 'get',
        params
    })
}

// 资产信息-获取打印模板
export function getTemplate(params) {
    return axios({
        url: api.getTemplate,
        method: 'get',
        params
    })
}

// 盘点计划-终止
export function checkState(params) {
    return axios({
        url: api.checkState,
        method: 'get',
        params
    })
}

// 盘点计划列表
export function checkPlanAll(params) {
    return axios({
        url: api.checkPlanAll,
        method: 'get',
        params
    })
}

// 盘点计划-详情
export function planDetails(params) {
    return axios({
        url: api.planDetails,
        method: 'get',
        params
    })
}

// 盘点计划详情-盘点记录
export function queryCheckList(params) {
    return axios({
        url: api.queryCheckList,
        method: 'get',
        params
    })
}

// 新增盘点计划 checkPlanCreate
export function checkPlanCreate(data) {
    return axios({
        url: api.checkPlanCreate,
        method: 'post',
        data
    })
}

// 删除盘点计划 checkPlanDelete
export function checkPlanDelete(id, data) {
    return axios({
        url: `${api.checkPlanDelete}/${id}`,
        method: 'delete',
        data
    })
}

// queryCheckInfo
export function queryCheckInfo(params) {
    return axios({
        url: api.queryCheckInfo,
        method: 'get',
        params
    })
}


// 盘点计划-人员树
export function queryUserList(params) {
    return axios({
        url: api.queryUserList,
        method: 'get',
        params
    })
}

export function queryName(data) {
    return axios({
        url: api.queryName,
        method: 'post',
        data
    })
}

// 资产类别-获取列表
export function categoryPage(params) {
    return axios({
        url: api.categoryPage,
        method: 'get',
        params
    })
}

// 资产信息-获取列表
export function infoAll(params) {
    return axios({
        url: api.infoAll,
        method: 'get',
        params
    })
}

// 资产信息-修改数据
export function infoUpdate(data) {
    return axios({
        url: api.infoUpdate,
        method: 'put',
        data
    })
}

// 资产信息-获取清查列表
export function checkList(params) {
    return axios({
        url: api.checkList,
        method: 'get',
        params
    })
}

// infoCreate
export function infoCreate(data) {
    return axios({
        url: api.infoCreate,
        method: 'post',
        data
    })
}

// 资产类别树
export function categoryTree(params) {
    return axios({
        url: api.categoryTree,
        method: 'get',
        params
    })
}

// 固定资产-查询固定资产名称
export function fuzzyQuery(params) {
    return axios({
        url: api.fuzzyQuery,
        method: 'get',
        params
    })
}

// supplierFuzzyQuery
export function supplierFuzzyQuery(params) {
    return axios({
        url: api.supplierFuzzyQuery,
        method: 'get',
        params
    })
}

// createSupplier
export function createSupplier(data) {
    return axios({
        url: api.createSupplier,
        method: 'post',
        data
    })
}

// 清查管理-删除
export function deleteCheckList(id, data) {
    return axios({
        url: `${api.deleteCheckList}/${id}`,
        method: 'delete',
        data
    })
}

// 清查管理-审核不通过 checkDelete
export function checkDelete(data) {
    return axios({
        url: api.checkDelete,
        method: 'post',
        data
    })
}

// 清查管理-审核通过 checkPass
export function checkPass(data) {
    return axios({
        url: api.checkPass,
        method: 'put',
        data
    })
}